home *** CD-ROM | disk | FTP | other *** search
- /* fdeget.c - get_cmd function - get an input */
- #include "stdio.h"
- #include "cminor.h"
- #include "viewcmds.h"
- #include "fdparm.h"
-
- /* definitions of key values returned by getkey */
- #include "keyio.h"
-
- int get_cmd() /* get next input command from keyboard */
- { /* returns the command type entered */
- int key ; /* holds the keyboard input value */
- /* ( see keyio.h ) for values */
- int cmd ; /* holds the command type value */
-
- prompt() ; /* display prompts */
- cmd = INVALIDCMD ; /* setup get next keyboard input */
- while(cmd == INVALIDCMD )
- { key = getkey() ; /* get next keyboard input */
- switch(key) /* classify the key pressed */
- {
- case PGDNKEY : cmd = NEXTPAGE ;break ;
- case PGUPKEY : cmd = PREVPAGE ;break ;
- case ASCESC : cmd = EXITPGM ;break ;
- case ' ' : cmd = MOVETOPOS ;break ;
- case HOMEKEY : cmd = FIRSTPAGE ;break ;
- case ENDKEY : cmd = LASTPAGE ;break ;
- case UPARROW : cmd = PREVLINE ;break ;
- case DOWNARROW : cmd = NEXTLINE ;break ;
- default : cmd - INVALIDCMD ;
- } /* end of switch stmt */
- }
- return(cmd) ;
- }
-
-